<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCategoriesTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up() {
        Schema::create('categories', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('order')->default(0)->comment('排序');
            $table->string('title')->comment('分类名');
            $table->string('desc')->nullable()->comment('分类描述');
            $table->integer('parent_id')->default(0)->comment('上级分类id');
            $table->string('logo')->nullable()->comment('分类logo');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down() {
        Schema::dropIfExists('categories');
    }

}
